<?php
/* Smarty version 3.1.30-dev/18, created on 2016-01-14 17:07:18
  from "C:\WDApplications\APMServ5.2.6\www\htdocs\wengdo\cms\templates\news_list.tpl" */

if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.30-dev/18',
  'unifunc' => 'content_56976546208964_31089609',
  'file_dependency' => 
  array (
    '6052a5e4ed70e5e011d67560a661f9a90e67964d' => 
    array (
      0 => 'C:\\WDApplications\\APMServ5.2.6\\www\\htdocs\\wengdo\\cms\\templates\\news_list.tpl',
      1 => 1452762432,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:header.tpl' => 1,
    'file:sidebar.tpl' => 1,
  ),
),false)) {
function content_56976546208964_31089609 ($_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<!-- Start: Main -->
<div id="main">
    <?php $_smarty_tpl->_subTemplateRender("file:sidebar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

    <!-- Start: Content -->
    <section id="content">
        <div id="topbar" class="affix">
            <ol class="breadcrumb">
                <li><a href="index.php"><span class="glyphicon glyphicon-home"></span></a></li>
                <li class="active">资讯管理</li>
            </ol>
        </div>
        <div class="container">

            <div class="row">
                <div class="col-md-12">
                    <div class="panel">
                        <div class="panel-heading">
                            <div class="panel-title">资讯列表</div>
                            <a href="news_add.php" class="btn btn-info btn-gradient pull-right"><span class="glyphicons glyphicon-plus"></span> 添加资讯</a>
                        </div>
                        <form action="news_list.php?act=delall&page=<?php echo $_smarty_tpl->tpl_vars['page']->value;?>
&pagecount=<?php echo $_smarty_tpl->tpl_vars['pagecount']->value;?>
&pagesize=<?php echo $_smarty_tpl->tpl_vars['pagesize']->value;?>
" method="post">
                            <div class="panel-body">
                                <table class="table table-striped table-bordered table-hover dataTable" id="">
                                    <tr class="active">
                                        <th class="text-center" width="100"><input type="checkbox" value="" id="checkall" class=""> 全选</th>
                                        <th>ID</th>
                                        <th>标题</th>
                                        <th>显示状态</th>
                                        <th>添加时间</th>
                                        <th width="200">操作</th>
                                    </tr>
                                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['news']->value, 'item');
foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->_loop = true;
$__foreach_item_0_saved = $_smarty_tpl->tpl_vars['item'];
?>
                                    <tr class="success">
                                        <td class="text-center"><input type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['newsid'];?>
" name="idarr[]" class="cbox"></td>
                                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['newsid'];?>
</td>
                                        <td>
                                            <span onclick="return title_blick(this)" > <?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
 </span>
                                            <input onblur="return title_blur(this,'<?php echo $_smarty_tpl->tpl_vars['item']->value['newsid'];?>
')" class="title_on" type="text" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
"/>
                                        </td>

                                        <td>
                                            <span onclick="return isdisplay_click(this,'<?php echo $_smarty_tpl->tpl_vars['item']->value['newsid'];?>
')"  <?php if ($_smarty_tpl->tpl_vars['item']->value['isdisplay'] == 1) {?> class="glyphicon glyphicon-ok" <?php } else { ?> class="glyphicon glyphicon-remove" <?php }?> ></span>
                                        </td>

                                        <td><?php echo date("Y-m-d H:i:s",$_smarty_tpl->tpl_vars['item']->value['addtime']);?>
</td>
                                        <td>
                                            <div class="btn-group">
                                                <a href="news_edit.php?newsid=<?php echo $_smarty_tpl->tpl_vars['item']->value['newsid'];?>
&page=<?php echo $_smarty_tpl->tpl_vars['page']->value;?>
" class="btn btn-default btn-gradient"><span class="glyphicons glyphicon-pencil"></span></a>
                                                <a onclick="return confirm('确定要删除吗？');" href="news_list.php?act=del&deleteid=<?php echo $_smarty_tpl->tpl_vars['item']->value['newsid'];?>
&page=<?php echo $_smarty_tpl->tpl_vars['page']->value;?>
&pagecount=<?php echo $_smarty_tpl->tpl_vars['pagecount']->value;?>
&pagesize=<?php echo $_smarty_tpl->tpl_vars['pagesize']->value;?>
" class="btn btn-default btn-gradient dropdown-toggle"><span class="glyphicons glyphicon-trash"></span></a>
                                            </div>
                                        </td>
                                    </tr>
                                    <?php
$_smarty_tpl->tpl_vars['item'] = $__foreach_item_0_saved;
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>
                                </table>

                                <div class="pull-left">
                                    <button type="submit" class="btn btn-default btn-gradient pull-right delall"><span class="glyphicons glyphicon-trash"></span></button>
                                </div>
                                <div class="pull-right">
                                   <?php echo $_smarty_tpl->tpl_vars['page_links']->value;?>

                                </div>

                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- End: Content -->
</div>
<!-- End: Main -->
</body>
</html>

<?php echo '<script'; ?>
>

    function isdisplay_click(obj,newsid){    //是否显示
        var  isshow = $(obj).attr("class");
        var isdisplay=0;
        isshow=="glyphicon glyphicon-ok" ? isdisplay=0 : isdisplay=1;
        var temp = "newsid=" + newsid + "&isdisplay=" + isdisplay + "&act=isdisplay";
        //alert(temp);return;
        $.ajax({
            type:"GET",
            url:"ajax.php?"+temp ,
            success:function(data){
                if(data=="是"){
                    $(obj).attr("class","glyphicon glyphicon-ok");
                }else{
                    $(obj).attr("class","glyphicon glyphicon-remove");
                }
            }
        });
    }

    function title_blick(obj){       //标题换成文本框
        $(obj).css("display","none");
        $(obj).next().css("display","inline").focus();
    }
    function title_blur(obj,newsid){    //修改标题
        var temp ="newsid=" + newsid + "&title=" + $(obj).val()+"&act=title";
        //alert(temp);
        //return;
        $.ajax({
            type:"GET",
            url:"ajax.php?" + temp ,
            success:function(data){
                $(obj).val(data);
                $(obj).css("display","none");
                $(obj).prev().text(data);
                $(obj).prev().css("display","inline");
            }
        });
    }

<?php echo '</script'; ?>
><?php }
}
